//
//  CouponManagerViewController.m
//  CouponManager
//
//  Created by BoHyun Jo on 11. 5. 29..
//  Copyright 2011 CJ오쇼핑. All rights reserved.
//

#import "CouponManagerViewController.h"


@implementation CouponManagerViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)dealloc
{
    [super dealloc];
}

- (void)didReceiveMemoryWarning
{
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    
    // Release any cached data, images, etc that aren't in use.
}

#pragma mark - View lifecycle

- (void)viewDidLoad
{
    [super viewDidLoad];
    
    CGRect tabFrame = tabBarController.view.frame;
//	tabFrame.size.height = tabFrame.size.height+28;
	tabFrame.origin.y -=20;
	tabBarController.view.frame = tabFrame;
    beforeButton = homeButton;
	[self.view addSubview:tabBarController.view];

  [tabBarController.tabBar insertSubview:tabBarView atIndex:[[tabBarController.tabBar subviews]count]];  
/*
    CGRect frame = CGRectMake(0, 0, 320, 49);
    UIView *view = [[UIView alloc] initWithFrame:frame];
    UIImage *tabBarBackgroundImage = [UIImage imageNamed:@"tabbar_background_crazybnn.png"];
    UIColor *color = [[UIColor alloc] initWithPatternImage:tabBarBackgroundImage];
    [view setBackgroundColor:color]; // 이미지를 setBackgroundColor 함수를 써서 지정했다.
    [color release];
    [tabBarController.tabBar insertSubview:view atIndex:0];
*/
    // Do any additional setup after loading the view from its nib.
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

-(IBAction)tabbarSelect:(UIButton*)sender{
    if(beforeButton !=nil)[beforeButton setSelected:NO];
    [sender setSelected:YES];
    beforeButton = sender;
    [tabBarController setSelectedIndex:[[sender titleForState:UIControlStateDisabled]intValue]];
    
}

@end
